-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(button -> negative): corrects interior label background color to align with parent #3078
Conversation
🦋 Changeset detectedLatest commit: 4dc7f9e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Deployed on https://pr-3078--spectrum-css.netlify.app |
File metricsSummaryTotal size: 4.11 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
Detailsbutton
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
3df3bde
to
458c8b0
Compare
458c8b0
to
a67009e
Compare
a67009e
to
4841afe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
0b00a81
to
4157992
Compare
components/button/index.css
Outdated
&.spectrum-Button--negative .spectrum-Button-label { | ||
forced-color-adjust: none; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--highcontrast-button-content-color-default: ButtonText; | ||
--highcontrast-button-content-color-hover: ButtonText; | ||
--highcontrast-button-content-color-focus: ButtonText; | ||
--highcontrast-button-content-color-down: ButtonText; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, I think it would be a good idea to be explicit about setting the matching background color too. Right now we're relying on the default.
--highcontrast-button-background-color-default: ButtonFace;
--highcontrast-button-background-color-hover: ButtonFace;
--highcontrast-button-background-color-down: ButtonFace;
--highcontrast-button-background-color-focus: ButtonFace;
--highcontrast-button-background-color-disabled: ButtonFace;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -306,6 +306,10 @@ a.spectrum-Button { | |||
/* Windows High Contrast Mode */ | |||
@media (forced-colors: active) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're cleaning up these high contrast styles, could you bring over some of the changes I made in the spectrum 2 migration here? The use of the Highlight
background should be paired with HighlightText
: 597d33f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if this lines up with what you're expecting 853ddac#diff-97b5a7e747486aca74b3076354c28a00ef69dab3c91dc0806d926078198571a2R335
Thanks for taking a look! 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you keep the &.spectrum-Button--accent.spectrum-Button--fill
selector the same for now? Removing the fill class hasn't been done yet in S1, so keeping that the same should avoid needing changes on the SWC side.
Also, really minor but it looks like the indentation needs an update there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Just reverted that.
eac62c6
to
dfa160a
Compare
dfa160a
to
32ccd99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those changes look good, thanks.
One last issue I am seeing is related to the border colors. I saw they were changing on hover of the outline variants in WHCM, but not the others. And the border colors should be the same as the background for the accent hover/focus/active.
I think adding something like this to the forced-colors styles should work? (not tested):
.spectrum-Button {
--highcontrast-button-border-color-default: ButtonBorder;
--highcontrast-button-border-color-hover: ButtonBorder;
--highcontrast-button-border-color-focus: ButtonBorder;
--highcontrast-button-border-color-down: ButtonBorder;
--mod-button-animation-duration: 0s;
&.spectrum-Button--accent.spectrum-Button--fill {
--highcontrast-button-border-color-default: ButtonText;
--highcontrast-button-border-color-hover: Highlight;
--highcontrast-button-border-color-focus: Highlight;
--highcontrast-button-border-color-down: Highlight;
}
}
I also got rid of the transition duration here since the system colors don't seem to transition and look quite strange while changing on hover/focus.
I'm a little unclear about what the hover colors should be, while ensuring contrast, given that originally it looks like the design intention was to change the border color on hover.
components/button/index.css
Outdated
--highcontrast-button-content-color-down: HighlightText; | ||
--highcontrast-button-content-color-focus: HighlightText; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These just need the indentation adjusted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing these on WHCM and they behave as I believe we're expecting. The outline variation border no longer transitions on hover.
I'm curious about the intent as well — outside of WHCM there's a subtle darkening of the whole outlined button, but that isn't going to work in high contrast mode.
I'm going to push up a change that includes the four property definitions added to .spectrum-Button
, the added mod (spacing included so we've got a distinction between the core properties and mods) and the updated .spectrum-Button--accent.spectrum-Button--fill
definitions.
e0e3f3f
to
c96ae2b
Compare
Pull request was closed
c96ae2b
to
135d345
Compare
135d345
to
280cab2
Compare
5d4054e
to
ec2fb49
Compare
…align with parent
Co-authored-by: Josh Winn <965114+jawinn@users.noreply.github.com>
af1d020
to
4dc7f9e
Compare
Description
How and where has this been tested?
Verified in Assistiv Labs high contrast mode-enabled Windows VM.
Validation steps
negative
variant.Regression testing
Validate:
Screenshots
To-do list